﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="SaveFileViewBinding.cs" company="">
//   
// </copyright>
// <summary>
//   The save file view binding.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Libium.Bindings
{
    using Libium.UseCases;
    using Libium.Views;

    /// <summary>
    ///   The save file view binding.
    /// </summary>
    public class SaveFileViewBinding : UseCaseBinding<ISaveFileUseCase, ISaveFileView>
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="SaveFileViewBinding"/> class.
        /// </summary>
        /// <param name="service">
        /// The service. 
        /// </param>
        /// <param name="useCase">
        /// The use case. 
        /// </param>
        /// <param name="view">
        /// The view. 
        /// </param>
        public SaveFileViewBinding(IBindService service, ISaveFileUseCase useCase, ISaveFileView view)
            : base(service, useCase, view)
        {
        }

        #endregion

        #region Public Methods and Operators

        /// <summary>
        ///   The bind.
        /// </summary>
        public override void Bind()
        {
            base.Bind();

            View.InitialDirectoryPath = UseCase.InitialDirectoryPath;
            View.Filters = UseCase.Filters;
            View.FilterIndex = UseCase.FilterIndex;
            View.FileName = UseCase.FileName;
            View.FileOk += () => UseCase.FilePath = View.FilePath;
        }

        #endregion
    }
}